package com.chuangke.system.listener;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.event.EventListener;
import org.springframework.scheduling.annotation.Async;

import com.chuangke.system.event.OptLogInsertEvent;
import com.chuangke.system.service.SysOptLogService;

@Configuration
public class OptLogInsertListener {

	@Autowired
	private SysOptLogService sysOptLogService;

	@Async
	@EventListener
	public void handleOptLogInsertEvent(OptLogInsertEvent event) {
		sysOptLogService.save(event.getOptLogs());
	}

}
